from django import forms
from captcha.fields import CaptchaField

class LoginForm(forms.Form):
	username=forms.CharField(required=True,error_messages={'required':'用户名不能为空',})#将username设置为必填
	password=forms.CharField(required=True, min_length=5,error_messages={'required':'密码不能为空','min_length':'密码长度不得少于5个字符'}) #password设置为必填

class RegisterForm(forms.Form):
	email=forms.EmailField(required=True)
	password=forms.CharField(required=True, min_length=5)
	captcha=CaptchaField(error_messages={"invalid":"验证码错误"})
#注册验证码实现
class ForgetForm(forms.Form):
	email=forms.EmailField(required=True)
	captcha=CaptchaField(error_messages={"invalid":"验证码错误"})
#重置密码
class ModifyPwdFrom(forms.Form):
	password1=forms.CharField(required=True, min_length=8)
	password2=forms.CharField(required=True, min_length=8)
		
		
		
